home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-03 | 4.1 KB | 154 lines | [TEXT/CWIE] |
- //========================================================================================
- //
- // File: Select.cpp
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "AMSample.hpp"
-
- #ifndef SELECT_H
- #include "Select.h"
- #endif
-
- #ifndef CONTENT_H
- #include "Content.h"
- #endif
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- // ----- OS Includes -----
-
- #ifndef FWBARRAY_H
- #include "FWBArray.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWSUSINK_H
- #include "FWSUSink.h"
- #endif
-
- #ifndef FWSTREAM_H
- #include "FWStream.h"
- #endif
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_Module_OpenDoc_StdProps_defined
- #include <StdProps.xh>
- #endif
-
- // ----- Macintosh Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__DRAG__)
- #include <Drag.h>
- #endif
-
- //========================================================================================
- // Runtime information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment AMSample
- #endif
-
- FW_DEFINE_AUTO(CAMSampleSelection)
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- const ODPropertyName kAMSamplePropText = "AMSample:Property:Text";
-
- //========================================================================================
- // CLASS CAMSampleSelection
- //========================================================================================
-
- //---------------------------------------------------------------------------------------
- // CAMSampleSelection constructor
- //---------------------------------------------------------------------------------------
-
- CAMSampleSelection::CAMSampleSelection(Environment* ev, CAMSampleContent* content) :
- FW_CSelection(ev, false, false),
- fAMSampleContent(content)
- {
- }
-
- //---------------------------------------------------------------------------------------
- // CAMSampleSelection destructor
- //---------------------------------------------------------------------------------------
-
- CAMSampleSelection::~CAMSampleSelection()
- {
- }
-
- //---------------------------------------------------------------------------------------
- // CAMSampleSelection::GetSelectedContent
- //---------------------------------------------------------------------------------------
- // The whole content is always selected
-
- FW_CContent* CAMSampleSelection::GetSelectedContent(Environment* ev)
- {
- return fAMSampleContent;
- }
-
- //---------------------------------------------------------------------------------------
- // CAMSampleSelection::ClearSelection
- //---------------------------------------------------------------------------------------
-
- void CAMSampleSelection::ClearSelection(Environment* ev)
- {
- fAMSampleContent->ClearTextData(ev);
- }
-
- //---------------------------------------------------------------------------------------
- // CAMSampleSelection::CloseSelection
- //---------------------------------------------------------------------------------------
-
- void CAMSampleSelection::CloseSelection(Environment* ev)
- {
- // Nothing to do
- }
-
- //---------------------------------------------------------------------------------------
- // CAMSampleSelection::IsEmpty
- //---------------------------------------------------------------------------------------
-
- FW_Boolean CAMSampleSelection::IsEmpty(Environment* ev) const
- {
- // Is the current string empty?
- return (fAMSampleContent->GetTextData().GetByteLength() == 0);
- }
-
- //---------------------------------------------------------------------------------------
- // CAMSampleSelection::SelectAll
- //---------------------------------------------------------------------------------------
-
- void CAMSampleSelection::SelectAll(Environment* ev)
- {
- // Part's data is always "selected"
- }
-